package com.douwong.student.activity;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ListView;

import com.alibaba.fastjson.JSON;
import com.douwong.student.R;
import com.douwong.student.adapter.FeatureDetailAdapter;
import com.douwong.student.base.BaseActivity;
import com.douwong.student.model.Features;

import java.util.ArrayList;

/**
 * 导读
 * 
 * @author Administrator
 * 
 */


public class FeaturesActivity extends BaseActivity {
	private ImageView go_back_img;
	private ArrayList<Features> featureList=new ArrayList<Features>();
	private ListView features_listview;
	private FeatureDetailAdapter adapter;


	@Override
	protected void initView() {
		setContentView(R.layout.daodu_layout);
		features_listview=(ListView) findViewById(R.id.features_listview);
		String string=getIntent().getStringExtra("features");
		//		FileUtils.writeRandomFile(FileUtils.APP_CRASH+"/111.txt", string.getBytes(), 0);
		featureList=(ArrayList<Features>) JSON.parseArray(string, Features.class);
		adapter=new FeatureDetailAdapter(FeaturesActivity.this, featureList);
		features_listview.setAdapter(adapter);
		//		for(int i=0;i<featureList.size();i++){
		//			Log.e("title",featureList.get(i).getTitle());
		//			Log.e("content",featureList.get(i).getContent());
		//		}
		//		Log.e("featureList",featureList.size()+"");
		go_back_img=(ImageView) findViewById(R.id.go_back_img);
		go_back_img.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				finish();

			}
		});

	}
}
